Giter Club home page Giter Club logo

Comments (14)

ewwink avatar ewwink commented on July 22, 2024 4

it can compiled using cygwin

$ make
cc  -Wall -std=c99   -c -o sockssrv.o sockssrv.c
cc  -Wall -std=c99   -c -o server.o server.c
cc  -Wall -std=c99   -c -o sblist.o sblist.c
sblist.c:8:2: warning: #warning "your C library sucks." [-Wcpp]
 #warning "your C library sucks."
  ^~~~~~~
cc  -Wall -std=c99   -c -o sblist_delete.o sblist_delete.c
cc  sockssrv.o server.o sblist.o sblist_delete.o -lpthread -o microsocks

$ ./microsocks.exe
client[4] 127.0.0.1: connected to x.x.x.x:443

@rofl0r if you don't use windows you can compile it online using appveyor

from microsocks.

rofl0r avatar rofl0r commented on July 22, 2024 3

i don't use windows, but maybe someone watching this repo can provide an exe ?
but i dont think it is very complicated, you basically just need to run mingw32-make which ships with mingw if i understand this correctly. they also mention this GUI: http://www.bloodshed.net/dev/devcpp.html

good luck. if you succeed, let us know how it worked.

from microsocks.

rofl0r avatar rofl0r commented on July 22, 2024 1

re your previous comment

Because MinGW is not a full port of the whole of Linux on your Windows machine.

this is not about linux, it's about POSIX, and to the best of my knowlegde, mingw tries to provide those APIs on top of M$' msvcrt runtime.

note that POSIX is meant as a portable standard to make programs work on all platforms, and windows used to ship a POSIX subsystem a while ago, but then removed it for some reason.

so windows is really the only OS which seems to be deliberately trying to push its own APIs instead of collaborating in the joint POSIX effort, and requiring programmers to write special code to support it.

from microsocks.

rofl0r avatar rofl0r commented on July 22, 2024

try this: compile it on linux, look which C files get compiled, then instruct to compile these files and link em together.
if you take the release tarball, you can probably just gcc *.c -o microsocks.
or maybe you do your homework and read up on how to use makefiles with mingw...

from microsocks.

barbadosa avatar barbadosa commented on July 22, 2024

rofl0r... Could you please compile the .exe for us and post it as a release?
Some of us aren't tech savvy enough to compile, but we would still like to use it.

from microsocks.

barbadosa avatar barbadosa commented on July 22, 2024

MinGW lacks pthreads by default so it fails from the start. So to compile microsocks, you would have to compile phtreads first...

MinGW-64 appears to have phtreads support, but running "make" in MinGW-64 console (mingw-w64.bat) will give a ton of errors of missing includes, one after another:

sockssrv.c:32:10: fatal error: sys/select.h: No such file or directory
sockssrv.c:34:10: fatal error: arpa/inet.h: No such file or directory
server.h:7:10: fatal error: sys/socket.h: No such file or directory
server.h:8:10: fatal error: netdb.h: No such file or directory

Because MinGW is not a full port of the whole of Linux on your Windows machine.

Cygwin is pretty much that, but it took me 8 hours to install as it has millions of files and is over 50GB in size, and I just don't bother with it anymore after having encountered errors compiling a project previously.

So, unless someone can release an .exe and/or a tutorial how to compile it, microsocks does not support Windows.

I wonder if you can build an exe on Linux? You should be able to?

from microsocks.

rofl0r avatar rofl0r commented on July 22, 2024

mingw (at least the official one from mingw.org) ships some sort of package manager where you can select pthread and get it installed. it will create a file libwinpthread-1.dll.
i know this because i'm involved in anotehr project where the main developer makes use of that package.

from microsocks.

barbadosa avatar barbadosa commented on July 22, 2024

When you re-run MinGW installer and do Install > Continue > Run Now, you get the MinGW Installation Manager.

You cannot select all packages, you have to mark them for install one by one, which is hell. There is no search function to search for "pthread". When I marked "wingw-developer-toolkit", it marked packages used in development, among them is "mingw32-libpthreadgc". But apparently it wasn't enough, because I still get this after running "mingw32-make":

"sockssrv.c:30:21: fatal error: pthread.h: No such file or directory"

(I also had to add "CC = gcc" to Makefile)

There is also a package called "mingw32-pthreads-w32", which is not selected when you select "wingw-developer-toolkit".

Installing it, did indeed add pthread support to MinGW. But now I'm getting the same errors I got in MinGW-64:

sockssrv.c:32:24: fatal error: sys/select.h: No such file or directory

from microsocks.

rofl0r avatar rofl0r commented on July 22, 2024

maybe there needs to be yet another package selected ? can "select.h" be located in mingw's directory tree ? if so, adding the right base path a la CPPFLAGS=-I/path/to/headers make might fix it...

from microsocks.

barbadosa avatar barbadosa commented on July 22, 2024

There is this:
https://github.com/wido/libs3/blob/master/inc/mingw/sys/select.h

// This file is used only on a MingW build, and converts an include of
// sys/select.h to its Windows equivalent

#include <winsock2.h>

Then I proceed to receive:

sockssrv.c:33:23: fatal error: arpa/inet.h: No such file or directory

Even though I have selected "msys-inetutils" in MinGW Installation Manager, it seems to not be enough. I commented it out, just to see if it's the last one, I received another error of a missing file. I have listed 4 of them is a post on this thread, the same ones I was getting with MinGW-64.

You are freely using any includes available in Linux, as you should, and MinGW simply does not include them. Cygwin does include a lot more of them, and maybe even all the ones used in microsocks, but I would have to wait for 8 hours again to install it, and who knows what kind of errors I would be encountering in the end.

from microsocks.

rofl0r avatar rofl0r commented on July 22, 2024

i agree that it is annoying that mingw doesn't install the full set of headers by default, but i do think that it provides all of them when you turn the right knobs. that said, again, this is not about linux, this is about posix. microsocks compiles and works fine on all platforms that adhere to that standard (linux, *bsd, mac os x, rtos, ...) and it should in theory even work on windows using one of cygwin / mingw / midipix, when properly configured.

from microsocks.

barbadosa avatar barbadosa commented on July 22, 2024

Yes, I can understand that the microsocks code is all right.
But I need to be able to run it on home PCs and a lot of them are Windows, so I have to make it work.

I believe I have selected all relevant packages in MinGW package manager.

From https://stackoverflow.com/questions/1517762/sockets-in-mingw:

BSD sys/socket.h is a POSIX header and the win32 API doesn't support it. MinGW headers are just a reimplementation of native win32 headers and don't offer additional POSIX compatibility.

If you are looking for sys/socket.h support, try either GNU gnulib's sys/socket.h replacement or go with Cygwin, which provides a POSIX compatibility wrapper on Windows.

So we come to the same conclusion.

from microsocks.

barbadosa avatar barbadosa commented on July 22, 2024

from microsocks.

rofl0r avatar rofl0r commented on July 22, 2024

you may come to #proxychains on irc.freenode.net

from microsocks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.